import request from '@/utils/request'

export function getRoles(params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}
export function delRoles(id) {
  return request({
    url: '/sys/role/' + id,
    method: 'DELETE'

  })
}
export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
export function updateRole(data) {
  return request({
    url: '/sys/role/' + data.id,
    method: 'PUT',
    data
  })
}
export function getRoleDetailById(id) {
  return request({
    url: '/sys/role/' + id,
    method: 'GET'

  })
}
export function assignPerm(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
